package com.msb.exception;

import java.util.ArrayList;
import java.util.List;

/**
 * java.lang.OutOfMemoryError：超出内存
 * 堆溢出
 * -Xmx20M -Xms20M
 */
public class HeapExceptionTest {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        int i = 0;
        while (true){
            System.out.println(i++);
            list.add(new String("hello world"));
        }
    }
}
